<html>
<head>
<title>People Search Example</title>
 
<script type="text/javascript" src="http://platform.linkedin.com/in.js">
  api_key: ii-zBPwonLeSXIiWIjeE1eMqGw4DxUfAryWCFdAuThMFjAjcgup53yqXkwSoAzzB
  authorize: true
</script>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link media="all" type="text/css" href="http://developer.linkedinlabs.com/tutorials/css/jqueryui.css" rel="stylesheet"/>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.5b1.js"></script>
  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js"></script>
 
<script type="text/javascript">
 
function loadData() {
  var mykey="Abhijit";
  var mycnt=2;
  IN.API.PeopleSearch()
         .fields("firstName", "lastName", "distance", "publicProfileUrl","pictureUrl")
         .params({"keywords": mykey, "count": mycnt, "sort": "distance"})
         .result(function(result) {
            profHTML = "<h4>People search for 'Abhijit':</h4>";
            for (var index in result.people.values) {
                profile = result.people.values[index]
                if (profile.pictureUrl) {
                    profHTML += "<p><a href=\"" + profile.publicProfileUrl + "\">";
                    profHTML += "<img class=img_border height=30 align=\"left\" src=\"" + profile.pictureUrl + "\"></a>";
                    profHTML += "<p>" + profile.firstName + " " + profile.lastName + " (" + profile.distance + ")</p>"; 
                }
            }  
      $("#search").html(profHTML);
      });
}
 
</script>
 
 
</head>
<body class="yui3-skin-sam  yui-skin-sam">
<div id="search">
    </div>
    <script type="IN/Login" data-onAuth="loadData"></script>
</body>
</html>
